<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>患者_同意书</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" type="text/css" href="../css/BasicPatientInformation.css" />
    <style>
        .aui-grid {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            z-index: 99;
        }

        .aui-card-list {
            width: 96%;
            margin: 0.3rem auto;
            border-radius: 0.5rem;
            box-shadow: 0 0 8px rgba(0, 0, 0, .1)
        }

        .textarea-outer {
            outline: none;
            border: none;
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 0.5rem 0;
            box-sizing: border-box;
            font-size: 0.6rem !important;
        }

        .aui-content-padded,
        .aui-list-item-inner,
        .aui-list-item-input,
        input[type='text'],
        input[type='number'] {
            font-size: 0.6rem !important;
            color: #666 !important;
        }

        .font-size-col {
            font-size: 0.6rem;
            text-indent: 1rem;
            padding: 0.6rem !important;
            color: #666 !important;
        }

        .text-wrapper {
            font-size: 0., 7rem;
            font-weight: 700;
            color: #333 !important;
        }

        .fontcolor li {
            color: #666 !important;
        }
    </style>
</head>

<body>
    <main id="app">
        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    一：谈话
                </div>
            </main>
        </section>

        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                谈话时间：
                            </div>
                            <div class="aui-list-item-input" id="time">

                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                谈话地点：
                            </div>
                            <div class="aui-list-item-input">
                                <select id="hllConversa">

                                </select>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </section>

        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    二：患者详情
                </div>
            </main>
        </section>

        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                姓名：<span id="aiName"></span>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                性别：<span id="aiGender" type="text" placeholder="性别" disabled="disabled"></span>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                年龄：<span id="aiAge"></span>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                科室：<span id="trSectionSource"></span>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                住院号：<span id="trPatientNo"></span>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </section>

        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    三：病情诊断
                </div>
            </main>
        </section>
        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">

                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                病情诊断：<span id="trDiagnosis"></span>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                其他诊断：<span id="trOtherDiagnosis"></span>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </section>
        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    四、 拟实施方案<select id="hllTreatment"
                        style="border:none;color: #595959;display: inline-block;width: 60%;margin-left: 10px;"></select>
                </div>
            </main>
        </section>
        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">
                    <div class="margin_bottom">
                        <p>
                            <input name="hllOxygenLevelOne" type="checkbox" value="1" lay-skin="primary"
                                checked />I级直排吸氧(自费)+氧气湿化;
                            <input name="hllOxygenLevelTwo" type="checkbox" value="1" lay-skin="primary"
                                checked />II级吸氧，建议
                            <input type="input" id="hllCourse"
                                style="text-align: center; width: 50px; border:none;  border: none 0;outline: medium;background: transparent;-webkit-appearance: none;-moz-appearance: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);-moz-tap-highlight-color: transparent;border-bottom: 1px solid #000; color: #595959;" />疗程。
                            治疗中患者本人和(或)他人因病情需要，或有急诊患者抢救时，上述治疗方案可能需要做相应调整。高压氧科医生根据患者(尤其一氧化碳中毒患者)
                            病情制定的高压氧治疗方案，患者必须遵从医嘱，否则后果自负。该项目已经通过我院医学伦理委员会的审查。
                        </p>
                    </div>
                </ul>
            </div>
        </section>
        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    五：高压氧治疗中可能出现的主要意外情况
                </div>
            </main>
        </section>
        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list fontcolor">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <label>
                                    <input name="hllAccidentOne" type="checkbox" value="1" lay-skin="primary"
                                        checked />1、由于调压不当造成中耳和/或鼻窦气压伤。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentTwo" type="checkbox" value="1" lay-skin="primary"
                                    checked />2、由于个体差异引起的氧过敏、氧中毒或减压病。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentThree" type="checkbox" value="1" lay-skin="primary"
                                    checked />3、患者尤其昏迷病者呼吸不当引起肺气压伤;、呕吐等原因引起呼吸道误吸。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentFour" type="checkbox" value="1" lay-skin="primary"
                                    checked />4、新近手术的患者出现切口部位皮下气肿、出血。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentFive" type="checkbox" value="1" lay-skin="primary"
                                    checked />5、颅底骨折和较大范围脑梗塞患者出现气颅、脑脊液漏、脑出血。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentSix" type="checkbox" value="1" lay-skin="primary"
                                    checked />6、由于血压波动,出现脑出血或脑梗塞。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentSeven" type="checkbox" value="1" lay-skin="primary"
                                    checked />7、癫痫发作。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentEight" type="checkbox" value="1" lay-skin="primary"
                                    checked />8、呼吸心跳骤停。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentNine" type="checkbox" value="1" lay-skin="primary"
                                    checked />9、高压氧治疗往返途中出现意外情况。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentTen" type="checkbox" value="1" lay-skin="primary"
                                    checked />10、由于携带违禁物品引起舱内爆炸、火灾。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-input aui-list-item-input-read-only">
                                <input name="hllAccidentEleven" type="checkbox" value="1" lay-skin="primary"
                                    checked />11、可能出现的其他不可预知的意外情况。<br />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                其他:
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="hllOther" placeholder="">
                            </div>

                        </div>
                    </li>
                    <p>
                        以上情况可能很轻微,也可能很严重, 甚至导致残疾或死亡。舱内患者如果发生紧急情况时，医护进入氧舱或患者减压出舱抢救需要一定的时间
                    </p>
                </ul>
            </div>
        </section>
        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    六、治疗中须遵守如下规定
                </div>
            </main>
        </section>
        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">
                    <li class="aui-list-item font-size-col">
                        1、患者必须遵从高压氧科医师医嘱进行高压氧治疗。治疗中服从医护人员指导及安排，否则发生影响本人及其他患者治疗或影响正常治疗情况时，为保障患者医疗安全，值班人员有权暂停有关患者的高压氧治疗。
                    </li>
                    <li class="aui-list-item font-size-col">
                        2、入舱人员严禁携带火柴、打火机、手机、手表、真空玻璃杯、电动玩具以及火药、有机溶剂等各类易燃易爆物品，携带物品需事先通知操舱人员。
                    </li>
                    <li class="aui-list-item font-size-col">
                        3、进舱前更换棉质服装被服，不得穿着未经防火和防静电处理的化纤织品。
                    </li>
                    <li class="aui-list-item font-size-col">
                        4、高压氧治疗期间，请勿自行调整治疗药物，以免影响疗效和引起危险。
                    </li>
                    <li class="aui-list-item font-size-col">
                        5、进舱人员需遵从指导在加压时做好调压动作，治疗时出现不适及时通报。
                    </li>
                    <li class="aui-list-item font-size-col">
                        6、治疗过程中，吸氧位置、治疗时间、何种体位须服从医务人员安排。
                    </li>
                </ul>
            </div>
        </section>
        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    七、医生已将上述内容及相关注意事项详细告知患者或患者家属、授权委托人。
                </div>
            </main>
        </section>
        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                医师签名:&nbsp;&nbsp;&nbsp;<img src="" id="hllCaSignature" alt="" style=" height:50px;">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                签名日期:&nbsp;&nbsp;&nbsp;<span  id="hllCaSignatureTime" style=" height:50px;">
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </section>
        <section class="aui-content-padded">
            <main id="zhiqing-container">
                <div class="text-wrapper">
                    八、患者意见
                </div>
            </main>
        </section>
        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">
                    <li class="aui-list-item font-size-col">
                        我已经如实报告病情，经高压氧科医师告知，已了解上述所有事项并表示理解。我同意接受高压氧治疗，遵守上述规定，并承担相应的风险。如不遵从医嘱或不及时报告舱内治疗时病情变化，出现问题，后果自负。
                    </li>
                </ul>
            </div>
        </section>

        <section class="aui-content-padded">
            <div class="aui-card-list">
                <ul class="aui-list aui-form-list">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                患者本人(或受托人)签名: <img src="" id="hllAutographbase64" style=" height:50px;">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                签名日期:&nbsp;&nbsp;&nbsp;<span id="hllAutographbase64Time" style=" height:50px;"></span>
                            </div>

                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                与患者关系:
                                <select id="hllSignType" style=" height:50px; font-size: 16px;">

                                </select>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                联系电话:
                                <input type="text" id="hllPhone" placeholder="">
                            </div>
                        </div>
                    </li>

                    <li class="aui-list-item" id="HiddenDisplay" style="padding:1.6rem 0">
                        <div class="aui-list-item-inner">
                            <div class="aui-bar aui-bar-btn aui-bar-btn-round" style="width:45%;">
                                <div class="aui-bar-btn-item aui-active" onclick="openSign()">签名</div>
                                <div class="aui-bar-btn-item" onclick="addInformedConsent()">提交</div>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </section>
        <!-- <div class="aui-card-list-footer aui-border-t">
            <span class="aui-col-xs-3">
                <img src="" id="hllAutographbase64" style="width:100px; height:50px;">
                <span src="" id="hllAutographbase64Time" style="width:100px; height:50px;"></span>
            </span>
        </div> -->
        <section class="aui-grid" id="sgin" style="display: none;">
            <div class="aui-col-xs-4" onclick="closeSign()">
                <i class="aui-iconfont aui-icon-close"></i>
                <div class="aui-grid-label">关闭签名</div>
            </div>
            <div class="aui-col-xs-4" onclick="clearSign()">
                <i class="aui-iconfont aui-icon-recovery"></i>
                <div class="aui-grid-label">清除全部</div>
            </div>
            <div class="aui-col-xs-4" onclick="saveSign()">
                <i class="aui-iconfont aui-icon-paper"></i>
                <div class="aui-grid-label">保存签名</div>
            </div>
        </section>
    </main>
    <input type="hidden " id="getF_ImplementationTreatmentPlan" value="">
    <input type="hidden " id="hllId" value="">
</body>
<script src="../script/api.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/vue.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/jquery.min.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/ToConfigure.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-toast.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-dialog.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-tab.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
    window.apiready = function () {
        //获取签字类型
        gethllSignType()
    }
    var vm = null;
    var type = false;
    var TrId = null;
    var F_ID = null;
    apiready = function () {
        //接收患者ID
        F_ID = api.pageParam.F_ID;
        TrId = api.pageParam.F_ID;
        var Url_IP = ToConfigure_IP("Gorgeous");
        vm = new Vue({
            el: '#app',
            data: {
                F_ID: 0, //患者唯一标识
                PictureInformation: "",
                getDateTime: '选择日期',
                getSigningTime: '选择日期',
            },
            created() {
                //获取签字类型
                gethllSignType()
                //获取谈话地点
                gethllConversa()
                //查询拟实施方案
                getDictionaryLibrary()
                //查询患者基本信息
                getHoTreatmentRecord(F_ID);
                //查询患者知情同意书
                getHoLoverLetter(F_ID);
            },
        })
    }
    //调用字典，查询拟实施方案
    function getDictionaryLibrary() {
        var JsParms = new Object();
        JsParms.dictionariesType = 346
        JsParms.pageSize = 999
        $.ajax({
            url: ToConfigure_IP("Gorgeous") + '/systemmanagement/dictionarylibrary/getDictionaryLibrary',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(JsParms),
            success: function (result) {
                var data = JSON.parse(JSON.stringify(result.data.list));
                var information = "<option value=''>请选择</option>";
                data.forEach(function (item) {
                    information += "<option value=\"" + item.dictionariesName + "\">" + item.dictionariesName + "</option>";

                });
                /**
                 * 清除下拉框
                 */
                $("#hllTreatment").html(information);
            }
        })
    }
    //获取谈话地点
    function gethllConversa() {
        var JsParms = new Object();
        JsParms.dictionariesType = 342
        JsParms.pageSize = 999
        //谈话地点
        $.ajax({
            url: ToConfigure_IP("Gorgeous") + '/systemmanagement/dictionarylibrary/getDictionaryLibrary',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(JsParms),
            success: function (result) {
                var data = JSON.parse(JSON.stringify(result.data.list));
                var information = "<option value=''>请选择</option>";
                data.forEach(function (item) {
                    information += "<option value=\"" + item.dictionariesName + "\">" + item.dictionariesName + "</option>";
                });
                /**
                 * 清除下拉框
                 */
                $("#hllConversa").html(information);
            }
        })
    }
    //获取签字类型
    function gethllSignType() {
        var JsParms = new Object();
        JsParms.dictionariesType = 784
        JsParms.pageSize = 999
        //谈话地点
        $.ajax({
            url: ToConfigure_IP("Gorgeous") + '/systemmanagement/dictionarylibrary/getDictionaryLibrary',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(JsParms),
            success: function (result) {
                var data = JSON.parse(JSON.stringify(result.data.list));
                var information = "";
                data.forEach(function (item) {
                    information += "<option value=\"" + item.dictionariesName + "\">" + item.dictionariesName + "</option>";
                });
                /**
                 * 清除下拉框
                 */
                $("#hllSignType").html(information);
                console.log("已渲染");
            }
        })
    }
    /**
    * 查询治疗登记
    */
    function getHoTreatmentRecord(F_ID) {
        var toast = new auiToast();
        /**
         * 组合条件
         * @type {Object}
         */
        var jsParms = new Object();
        /**
         *  治疗登记id
         */
        jsParms.trId = F_ID;
        /**
         * 请求控制器
         */
        $.ajax({
            url: ToConfigure_IP("Gorgeous") + '/businessmanagement/hotreatmentregister/getHoTreatmentRegister',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(jsParms),
            success: function (result) {
                /**
                 * 验证返回信息是否为空
                 */
                if (result.success == true) {
                    /**
                     *  循环object
                     */
                    $.each(result.data.list, function (i, o) {
                        // 时间赋值
                        $("#time").text(getNowFormatDate());
                        // // 住院/门诊号赋值
                        $("#trPatientNo").text(o.trPatientNo);
                        // /**
                        //  * 档案编号
                        //  */
                        // $("#aiNumber").text(o.hoArchivalInformationEntity.aiNumber);
                        // 姓名赋值
                        $("#aiName").text(o.hoArchivalInformationEntity.aiName);
                        // 年龄赋值
                        $("#aiAge").text(o.hoArchivalInformationEntity.aiAge);
                        // 性别赋值
                        $("#aiGender").text(o.hoArchivalInformationEntity.aiGender);
                        // 床号赋值
                        $("#trIsBed").text(o.trIsBed);
                        // 科室赋值
                        $("#trSectionSource").text(o.trSectionSource);
                        // 诊断赋值
                        $("#trDiagnosis").text(o.trDiagnosis);
                        // 其他诊断赋值
                        $("#trOtherDiagnosis").text(o.trOtherDiagnosis);
                        // $("#trId").text(o.trId);
                        //渲染患者本人(或者委托人)签名
                        // $("#handwritingBoard").attr("src", "data:image/png;base64," + o.trPatientSign);
                    })

                } else {
                    /**
                     *  弹窗提示 暂无相关信息
                     */
                    toast.fail({
                        title: "暂无信息",
                        duration: 2000
                    });
                }
            },
            error: function (result) {
                /**
                 * 关闭加载框
                 */
                // layui.notice.destroy();
                /**
                 *  提示错误信息
                 */
            }
        });
    }
    /**
     * 查询知情同意书
     * @param currPage 当前页
     */
    function getHoLoverLetter(F_ID) {
        var toast = new auiToast();
        /**
         * 获取参数
         */
        var jsonStr = new Object();
        jsonStr.hllTrId = F_ID
        /**
         * 验证参数是否为空
         */
        /**
         * 请求控制器
         */
        $.ajax({
            url: ToConfigure_IP("Gorgeous") + '/businessmanagement/holoverletter/getHoLoverLetter',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(jsonStr),
            success: function (result) {
                /**
                 * 验证返回信息是否为空
                 */
                if (result.data.list.length > 0) {
                    /**
                     *  循环object
                     */
                    $.each(result.data.list, function (i, o) {
                        /**
                         *
                         */
                        $("#hllId").val(o.hllId);
                        /**
                         *
                         */
                        $("#hllConversa").find("option[value='" + o.hllConversa + "']").attr("selected", true);
                        /**
                         *
                         */
                        $("#hllTreatment").find("option[value='" + o.hllTreatment + "']").attr("selected", true);
                        /**
                         * 疗程
                         */
                        document.getElementById('hllCourse').setAttribute('value', o.hllCourse);
                        /**
                         * 其他
                         */
                        document.getElementById('hllOther').setAttribute('value', o.hllOther);
                        /**
                         * 签字类型
                         */
                        console.log(o.hllSignType);
                        $("#hllSignType").find("option[value='" + o.hllSignType + "']").attr("selected", true);
                        if (o.hllPhone!=null) {
                            /**
                         * 联系电话
                         */
                            document.getElementById('hllPhone').setAttribute('value', o.hllPhone);
                        }
                        /**
                         * 吸氧等级1
                         */
                        if (o.hllOxygenLevelOne == 1) {
                            $("[name = 'hllOxygenLevelOne']").attr("checked", true);

                        } else {
                            $("[name = 'hllOxygenLevelOne']").attr("checked", false);

                        }
                        /**
                         * 吸氧等级2
                         */
                        if (o.hllOxygenLevelTwo == 1) {
                            $("[name = 'hllOxygenLevelTwo']").attr("checked", true);

                        } else {
                            $("[name = 'hllOxygenLevelTwo']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentOne == 1) {
                            $("[name = 'hllAccidentOne']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentOne']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentTwo == 1) {
                            $("[name = 'hllAccidentTwo']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentTwo']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentThree == 1) {
                            $("[name = 'hllAccidentThree']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentThree']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentFour == 1) {
                            $("[name = 'hllAccidentFour']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentFour']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentFive == 1) {
                            $("[name = 'hllAccidentFive']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentFive']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentSix == 1) {
                            $("[name = 'hllAccidentSix']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentSix']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentSeven == 1) {
                            $("[name = 'hllAccidentSeven']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentSeven']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentEight == 1) {
                            $("[name = 'hllAccidentEight']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentEight']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentNine == 1) {
                            $("[name = 'hllAccidentNine']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentNine']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentTen == 1) {
                            $("[name = 'hllAccidentTen']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentTen']").attr("checked", false);

                        }
                        /**
                         * 意外情况
                         */
                        if (o.hllAccidentEleven == 1) {
                            $("[name = 'hllAccidentEleven']").attr("checked", true);

                        } else {
                            $("[name = 'hllAccidentEleven']").attr("checked", false);

                        }
                        $("#hllCaSignature").attr('src', o.hllCaSignature);
                        $("#hllCaSignature").val(o.hllCaSignature);
                        $("#hllCaSignatureTime").html(format(o.hllCaSignatureTime,"YYYY-MM-DD hh:mm:ss"));
                        $("#hllAutographbase64").attr('src', o.hllAutographbase64)
                        $("#hllAutographbase64").val(o.hllAutographbase64)
                        $("#hllAutographbase64Time").html(o.hllAutographbase64Time)

                    })
                    type = true;
                } else {
                    /**
                     *  弹窗提示 暂无相关信息
                     */
                    toast.fail({
                        title: "暂无信息",
                        duration: 2000
                    });
                }
            },
            error: function (result) {
                // /**
                //  * 关闭加载框
                //  */
                // layui.notice.destroy();
                // /**
                //  *  提示错误信息
                //  */
                // layui.notice.msg('操作失败', { icon: 2 });
            }
        });
    }
    //获取当前时间
    function getNowFormatDate() {

        var date = new Date();

        var seperator1 = "-";

        var seperator2 = ":";

        var month = date.getMonth() + 1;

        var strDate = date.getDate();

        if (month >= 1 && month <= 9) {

            month = "0" + month;

        }

        if (strDate >= 0 && strDate <= 9) {

            strDate = "0" + strDate;

        }

        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate

            + " " + date.getHours() + seperator2 + date.getMinutes()

            + seperator2 + date.getSeconds();

        return currentdate;

    }
    //添加知情同意书
    function addInformedConsent() {
        var toast = new auiToast();
        //获取所属医院IP地址
        var Url_IP = ToConfigure_IP("Gorgeous");
        /**
        * 参数
        * @type {string}
        */
        var jsParms = new Object();
        var jsStr = parameters(2);
        if (type == false) {
            /**
             * 请求控制器
             */
            $.ajax({
                url: Url_IP + '/businessmanagement/holoverletter/insertHoLoverLetter',
                type: "post",
                async: false,
                contentType: "application/json",
                dataType: "json",
                data: jsStr,
                success: function (result) {
                    /**
                     * 验证返回信息是否正确
                     */
                    if (result.data > 0) {
                        toast.success({
                            title: "提交成功",
                            duration: 2000
                        });
                        getHoLoverLetter(F_ID)
                    } else {
                        /**
                        *  提示错误信息
                        */
                        toast.fail({
                            title: "提交失败",
                            duration: 2000
                        });
                    }
                },
                error: function (result) {
                    /**
                     *  提示错误信息
                     */
                    toast.fail({
                        title: "提交失败",
                        duration: 2000
                    });
                }
            });
        } else {
            jsParms.hllId = $("#hllId").val();
            /**
             * 请求控制器
             */
            $.ajax({
                url: Url_IP + '/businessmanagement/holoverletter/updateHoLoverLetter',
                type: "post",
                async: false,
                contentType: "application/json",
                dataType: "json",
                data: jsStr,
                success: function (result) {
                    /**
                     * 验证返回信息是否正确
                     */
                    if (result.data > 0) {
                        toast.success({
                            title: "提交成功",
                            duration: 2000
                        });
                        getHoLoverLetter(F_ID)
                    } else {
                        /**
                        *  提示错误信息
                        */
                        toast.fail({
                            title: "提交失败",
                            duration: 2000
                        });
                    }
                },
                error: function (result) {
                    /**
                     *  提示错误信息
                     */
                    toast.fail({
                        title: "提交失败",
                        duration: 2000
                    });
                }
            });
        }
    }

    // 打开电子签名板
    function openSign() {
        $('#sgin').show();
        // 画板
        var drawingBoard = api.require('drawingBoard');
        drawingBoard.open({
            rect: {
                x: 17,
                y: api.winHeight - 800,
                w: api.winWidth - 35,
                h: 400
            },
            styles: {
                brush: {
                    color: '#000000',
                    width: 3
                },
                bgColor: 'rgba(0, 0, 0, .6)'
            },
            fixedOn: api.frameName
        });
    }



    // 撤销最新的一笔
    function cancelStep() {
        var drawingBoard = api.require('drawingBoard');
        drawingBoard.revoke();
    }

    // 关闭签名
    function closeSign() {
        var drawingBoard = api.require('drawingBoard');
        api.confirm({
            title: '是否确定关闭签名？',
            buttons: ['确定', '取消']
        }, function (ret, err) {
            if (ret) {
                if (ret.buttonIndex === 1) {
                    drawingBoard.close();
                    $('#sgin').hide();
                }
            }
        })
    }

    // 恢复撤销
    function revocationSign() {
        var drawingBoard = api.require('drawingBoard');
        drawingBoard.restore();
    }

    // 清除全部
    function clearSign() {
        var drawingBoard = api.require('drawingBoard');
        api.confirm({
            title: '是否确定清除全部？',
            buttons: ['确定', '取消']
        }, function (ret, err) {
            if (ret) {
                if (ret.buttonIndex === 1) {
                    drawingBoard.clear();
                }
            }
        })
    }


    // 保存签名
    function saveSign() {
        var toast = new auiToast();
        api.confirm({
            title: '是否确定保存？',
            msg: '请检查签名是否书写正确',
            buttons: ['确定', '取消']
        }, function (ret, err) {
            if (ret) {
                if (ret.buttonIndex === 1) {
                    var drawingBoard = api.require('drawingBoard');
                    drawingBoard.save({
                        savePath: 'fs://hyperbaric/result.png',
                        copyToAlbum: false
                    }, function (ret) {
                        if (ret.absolutePath) {
                            var trans = api.require('trans');

                            trans.decodeImgToBase64({
                                imgPath: ret.absolutePath
                            }, function (ret, err) {
                                if (ret.status) {
                                    //获取base64图片文件流
                                    $("#hllAutographbase64").attr('src', "data:image/png;base64," + ret.base64Str)
                                    $("#hllAutographbase64").val("data:image/png;base64," + ret.base64Str)
                                    $("#hllAutographbase64Time").html(ser())
                                    //提示成功弹窗
                                    toast.success({
                                        title: "操作成功",
                                        duration: 2000
                                    });
                                    //调用关闭签名
                                    drawingBoard.close();
                                    $('#sgin').hide();
                                } else {
                                    toast.fail({
                                        title: "提交失败",
                                        duration: 2000
                                    });
                                }
                            });
                        } else {
                            api.toast({
                                msg: '保存失败',
                                duration: 1000,
                                location: 'bottom'
                            });
                        }
                    });
                }
            } else {
                api.toast({
                    msg: '操作异常',
                    duration: 1000,
                    location: 'bottom'
                });
            }
        });
    }




    //获取参数
    /**
 * 获取参数信息
 * @param type 操作类型（1：修改    2：添加）
 * @returns {string}
 */
    function parameters(type) {

        /**
         * 组合条件
         * @type {Object}
         */
        var jsParms = new Object();
        /**
         * 操作类型
         */
        if (type == 1) {
            /**
             * 交接班记录唯一标识
             */
            jsParms.hllId = $("#hllId").val();
            /**
             * 交接班记录唯一标识
             */
            jsParms.hllTrId = $("#trId").val();
            /**
             * 验证是否为空
             */
            if (jsParms.hllTrId == 0 || jsParms.hllTrId == undefined || jsParms.hllTrId == null) {
                return;
            }

        } else if (type == 2) {
            //患者签字
            jsParms.hllAutographbase64 = document.getElementById('hllAutographbase64').value;
            jsParms.hllAutographbase64Time = $("#hllAutographbase64Time").html();
            jsParms.hllCaSignature = $("#hllCaSignature").val();
            jsParms.hllCaSignatureTime = $("#hllCaSignatureTime").val();
            jsParms.hllSignType = $("#hllSignType").val();
            jsParms.hllPhone = $("#hllPhone").val();
            /**
             * 交接班记录Id
             */
            jsParms.hllId = $("#hllId").val();

            /**
             * 交接班记录Id
             */
            jsParms.hllTrId = F_ID;
            /**
             *
             */
            jsParms.hllConversa = $("#hllConversa").val();
            /**
             *
             */
            jsParms.hllTreatment = $("#hllTreatment").val();
            /**
             *
             */
            jsParms.hllCourse = $("#hllCourse").val();
            /**
             *
             */
            jsParms.hllOther = $("#hllOther").val();
            /**
             * 问诊时间
             * @type {jQuery}
             */
            jsParms.hllTime = $("#hllTime").val();
            /**
             * Ca电子签名图片
             * @type {jQuery}
             */
            jsParms.hllCaSignature = $("#CaSignature").attr('src');
            /**
             *吸氧等级
             */
            $('input[name=hllOxygenLevelOne]:checked').each(function () {
                /**
                 * 给供排氧系统赋值
                 */
                jsParms.hllOxygenLevelOne = $(this).val();
            });
            if (jsParms.hllOxygenLevelOne == null || jsParms.hllOxygenLevelOne == undefined) {
                jsParms.hllOxygenLevelOne = 0;
            }
            /**
             *吸氧等级
             */
            $('input[name=hllOxygenLevelTwo]:checked').each(function () {
                /**
                 * 给供排氧系统赋值
                 */
                jsParms.hllOxygenLevelTwo = $(this).val();
            });
            if (jsParms.hllOxygenLevelTwo == null || jsParms.hllOxygenLevelTwo == undefined) {
                jsParms.hllOxygenLevelTwo = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentOne]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentOne = $(this).val();
            });
            if (jsParms.hllAccidentOne == null || jsParms.hllAccidentOne == undefined) {
                jsParms.hllAccidentOne = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentTwo]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentTwo = $(this).val();
            });
            if (jsParms.hllAccidentTwo == null || jsParms.hllAccidentTwo == undefined) {
                jsParms.hllAccidentTwo = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentThree]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentThree = $(this).val();
            });
            if (jsParms.hllAccidentThree == null || jsParms.hllAccidentThree == undefined) {
                jsParms.hllAccidentThree = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentFour]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentFour = $(this).val();
            });
            if (jsParms.hllAccidentFour == null || jsParms.hllAccidentFour == undefined) {
                jsParms.hllAccidentFour = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentFive]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentFive = $(this).val();
            });
            if (jsParms.hllAccidentFive == null || jsParms.hllAccidentFive == undefined) {
                jsParms.hllAccidentFive = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentSix]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentSix = $(this).val();
            });
            if (jsParms.hllAccidentSix == null || jsParms.hllAccidentSix == undefined) {
                jsParms.hllAccidentSix = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentSeven]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentSeven = $(this).val();
            });
            if (jsParms.hllAccidentSeven == null || jsParms.hllAccidentSeven == undefined) {
                jsParms.hllAccidentSeven = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentEight]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentEight = $(this).val();
            });
            if (jsParms.hllAccidentEight == null || jsParms.hllAccidentEight == undefined) {
                jsParms.hllAccidentEight = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentNine]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentNine = $(this).val();
            });
            if (jsParms.hllAccidentNine == null || jsParms.hllAccidentNine == undefined) {
                jsParms.hllAccidentNine = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentTen]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentTen = $(this).val();
            });
            if (jsParms.hllAccidentTen == null || jsParms.hllAccidentTen == undefined) {
                jsParms.hllAccidentTen = 0;
            }
            /**
             *意外情况
             */
            $('input[name=hllAccidentEleven]:checked').each(function () {
                /**
                 *
                 */
                jsParms.hllAccidentEleven = $(this).val();
            });
            if (jsParms.hllAccidentEleven == null || jsParms.hllAccidentEleven == undefined) {
                jsParms.hllAccidentEleven = 0;
            }
        }
        /**
         * Json转换
         */
        return JSON.stringify(jsParms);
    }
    function ser() {
        var d = new Date()
        return d.getFullYear() + '-' + ((d.getMonth() < 9 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1))) +
            '-' + (d.getDate() < 10 ? '0' + d.getDate() : d.getDate()) + ' ' + (d.getHours() < 10 ? '0' + d.getHours() : d.getHours()) +
            ':' + (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()) + ':' + (d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds())
    }
    format = function (date, format) {
        if (!date) {
            return "";
        }
        let d = new Date(date);
        // 年
        if (/YYYY/.test(format)) {
            format = format.replace(/YYYY/, d.getFullYear());
        }
        // 月份
        let month = d.getMonth() + 1;
        if (/MM/.test(format)) {
            let monthStr = month < 10 ? "0" + month : month;
            format = format.replace(/MM/, monthStr);
        } else if (/M/.test(format)) {
            format = format.replace(/M/, month);
        }
        // 日期
        let dates = d.getDate();
        if (/DD/.test(format)) {
            let dateStr = dates < 10 ? "0" + dates : dates;
            format = format.replace(/DD/, dateStr);
        } else if (/D/.test(format)) {
            format = format.replace(/D/, dates);
        }
        // 小时
        let hours = d.getHours();
        if (/HH/.test(format)) {
            let hoursStr = hours < 10 ? "0" + hours : hours;
            format = format.replace(/HH/, hoursStr);
        } else if (/H/.test(format)) {
            format = format.replace(/H/, hours);
        } else if (/hh/.test(format)) {
            let hoursMin = hours > 12 ? hours - 12 : hours;
            let hoursStr = hoursMin < 10 ? "0" + hoursMin : hoursMin;
            format = format.replace(/hh/, hoursStr);
        } else if (/h/.test(format)) {
            let hoursMin = hours > 12 ? hours - 12 : hours;
            format = format.replace(/h/, hoursMin);
        }
        // 分
        let minutes = d.getMinutes();
        if (/mm/.test(format)) {
            let minutesStr = minutes < 10 ? "0" + minutes : minutes;
            format = format.replace(/mm/, minutesStr);
        } else if (/m/.test(format)) {
            format = format.replace(/m/, minutes);
        }
        // 秒
        let seconds = d.getSeconds();
        if (/ss/.test(format)) {
            let secondsStr = seconds < 10 ? "0" + seconds : seconds;
            format = format.replace(/ss/, secondsStr);
        } else if (/s/.test(format)) {
            format = format.replace(/s/, seconds);
        }
        return format;
    }
</script>

</html>